import React,{Component} from "react"
import "./index.css"
import RightContainer from "../../../components/RightContainer"
import { Input, Space, Table} from 'antd';
const { Search } = Input;
import { Switch } from 'antd';
class list extends Component{
    state={
        columns:[
            {
              title: '商品ID',
              dataIndex: 'age',
              key: 'age',
            },
            {
              title: '商品主图',
              dataIndex: 'address',
              key: 'address',
            },
            {
              title: '商品名称',
              dataIndex: 'name',
              key: 'name',
              render: text => <a>{text}</a>,
            },
            {
                title: '价格',
                dataIndex: 'addy',
                key: 'addy',
            },
            {
                title: '库存',
                dataIndex: 'addif',
                key: 'addif',
            },
            {
                title: '销量',
                dataIndex: 'phone',
                key: 'phone',
            },
            {
              title: '属性',
              dataIndex: 'position',
              key: 'position',
          },
            {
              title: '是否上架',
              key: 'tags',
              render: (text, record) => (
                <Switch checkedChildren="上架" unCheckedChildren="下架" defaultChecked />
              ),
              
            },
            {
                title: '创建时间',
                key: 'time',
                dataIndex: 'time',
                
              },
            {
              title: '操作',
              key: 'action',
              render: (text, record) => (
                <Space size="middle">
                  <a>编辑</a>
                  <a>删除</a>
                </Space>
              ),
            },
          ],
          data:[
            {
              key: '1',
              name: 'John',
              age: 32,
              address: 'New',
              tags: 'developer',
              addy:"sfsdff",
              addif:"收款机房不好",
              phone:"jgjggvh",
              position:"就黄果树",
              time:"sjdhgbjhs"
            },
            {
              key: '2',
              name: 'Green',
              age: 42,
              address: 'London ',
              tags: ['loser'],
              addy:"sfsdff",
              addif:"收款机房不",
              phone:"jgjggvh",
              position:"就黄果树",
              time:"sjdhgbjhs"
            },
            {
              key: '3',
              name: 'Black',
              age: 32,
              address: 'Sidney',
              tags: 'teacher',
              addy:"sfsdff",
              addif:"收款机房不好",
              phone:"jgjggvh",
              position:"就黄果树",
              time:"sjdhgbjhs"
            },
          ]
        
    }
    render(){
        const {data,columns}=this.state
        return <RightContainer>
            <div >
            <Search placeholder="ID/名称/货号" onSearch={this.onSearch} style={{ width: 200 }} />
            </div>
            <div>
            <Table columns={columns} dataSource={data} />
            </div>
        </RightContainer>
    }
}
export default list